<?php
namespace app\merchant\model;

use think\Model;

/**
 * 商户
 * @property string $id
 * @property string $user_id
 * @property string $license 营业执照拍照
 * @property string $idcard 法人身份证拍照
 * @property string $location 店铺位置
 * @property string $main_products 主营商品
 * @property string $time
 * @property string $status
 */
class MerchantModel extends Model
{
    protected $table="merchant";
    public function install()
    {
        $table=$this->db()->getTable();
        $sql="CREATE TABLE IF NOT EXISTS `$table` (
            `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
            `user_id` INT NOT NULL , 
            `license` VARCHAR(100) NOT NULL , 
            `idcard` VARCHAR(20) NOT NULL , 
            `location` VARCHAR(100) NOT NULL , 
            `main_products` VARCHAR(100) NOT NULL , 
            `time` INT NOT NULL , 
            `status` INT NOT NULL
        ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
        $this->db()->execute($sql);
    }
}
